package Test2;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class Test {
    public static void main(String[] args) throws FileNotFoundException {
        try(InputStream is=new FileInputStream("test.docx")){
            byte[] b=new byte[1024];
            int len=0;
            while(true){
                len=is.read(b);
                if(len == -1){
                    break;
                }
            }
            for (int i = 0; i < len; i += 3) {
                String s = new String(b, i, 3, "UTF-8");
                System.out.printf("%s", s);
            }
        }
    }
    public static void main1(String[] args) {
        try(InputStream is = new FileInputStream("test.docx")){
            while(true){
                int b= is.read();
                if(b==-1){
                    break;
                }
                System.out.printf("%c",b);
            }
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
